/* --------------------------------------------------------
 * Copyright (c) aeky , Inc.  All rights reserved.
 * --------------------------------------------------------
 */
package com.aeky.server.dao;

import java.util.List;
import java.util.Map;

import com.aeky.common.Page;

/**
 * 
 * @author aeky
 */
public interface BaseDao<T> {

    /**
     * Sets the entity class.
     * 
     * @param entityClass the new entity class
     */
    void setEntityClass(Class<T> entityClass);

    /**
     * Adds the.
     * 
     * @param model the model
     */
    void add(Object model);

    /**
     * Update.
     * 
     * @param model the model
     * 
     * @return the t
     */
    T update(T model);

    /**
     * Delete.
     * 
     * @param model the model
     */
    void delete(Object model);

    /**
     * Load.
     * 
     * @param id the id
     * 
     * @return the t
     */
    T load(Object id);

    /**
     * Gets the all.
     * 
     * @return the all
     */
    List<T> getAll();

    /**
     * Gets the all.
     * 
     * @param orderBy the order by
     * 
     * @return the all
     */
    List<T> getAll(String orderBy);

    Page<T> listByPage(Map<String, Object> map, Page<T> page);
}
